(function($,document){
    var defaults = {
        Text:"正在下载,请稍后...",
        css:{
            minWidth:133,
            minHeight:20,
            bg:"#ffffff",
            boder:1,
            boderC:"#ffffff",
            fontSize:14,
            fontC:"#000000",
            display:"block",
            position:"absolute",
            transform:"translate(-50% -50%)",
            imgUrl:"../img/loading2.gif"
        }
    };
    var divContent;
    //窗口大小变化
    $(window).resize(function() {
        LoadInfo.prototype.div();
    });

    var LoadInfo = function(){
       var that = this;
   };

    LoadInfo.prototype = {
        mesg:function (thisContent){
            if(thisContent == null || thisContent == undefined) thisContent =defaults.Text;
            divContent = thisContent;
            this.div();

        },
        div:function(){
            var loadDiv = '<div class="loadContent" ><img src="'+defaults.css.imgUrl+'" alt="">' + divContent + '</div>';
            $("body").append(loadDiv);

            var windowH = $(window).height();
            var windowW = $(window).width();
            var thisH = parseInt($(".loadContent").css("height"))/2;
            var thisW = parseInt($(".loadContent").css("width"))/2;
            var divH = windowH/2 - thisH + "px";
            var divW = windowW/2- thisW + "px";

            $(".loadContent").css({
                minWidth:defaults.css.minWidth,
                minHeight:defaults.css.minHeight,
                background:defaults.css.bg,
                boder:defaults.css.boder,
                fontSize:defaults.css.fontSize,
                color:defaults.css.fontC,
                position:defaults.css.position,
                left:divW,
                top:divH,
                transform:"translate(-50% -50%)"
            });
            $(".loadContent").fadeIn(1000);

        }
    };
    window.LoadInfo = function () {
        return new LoadInfo()
    };

})(jQuery, document);

var loadInfo=new LoadInfo;